﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Timer : MonoBehaviour {

    public float initTime;
    public UILabel timeLabel;
    public GameObject VerificationCodeBtn;
	void Start () {
        initTime = 60;
	}
		
	void Update () {
        initTime -= Time.deltaTime;
        timeLabel.text = (int)initTime + "";
        if (VerificationCodeBtn.activeSelf == true || initTime <= 0)
        {
            initTime = 60;
        }

        if(initTime <= 0){
            VerificationCodeBtn.SetActive(true);
            gameObject.SetActive(false);
        }
	}
}
